<?php 
namespace Home\Controller;
use Think\Controller;
use Fn;
class ExtendController extends Controller {
   
    public function xpublic(){
        $this->_cmd('_noAuth');
    }
    
    public function ajaxRespond($p,$zip = false){
        if($zip){
            ob_start("ob_gzhandler");
            echo json_encode($p);
            ob_end_flush();
        }else{
            echo json_encode($p);
        }
        exit;
    }
    
    
    protected function _cmd($fnPre){

    	//var_dump($_GET);
		$c = trim(I('get.cmd','','strtolower'));
    	//var_dump($c);
    	$fn = $fnPre.$c;
    	
    	if(method_exists($this, $fn)){
    		return $this->$fn();
    	}
    }

}